# else clause in loop
my_list = [1, 2, 3, 4, 5]
for i in my_list:
    if i == 3:
        print("Item found!")
        break
    print(i)
else:
    print("Item not found!")

# else clause in exception
my_dict = {"a": 1, "b": 2, "c": 3}
try:
    value = my_dict["a"]
except KeyError:
    print("A KeyError occurred!")
else:
    print("No error occurred!")
finally:
    print("The finally statement ran!")
